package com.kenobi;

//import android.app.ListFragment;
import android.view.View;
import android.widget.ListView;
import android.support.v4.app.ListFragment;

import com.kenobi.MusicListViewController.EventCallback;

public class MusicListFragment extends ListFragment {
	
	private EventCallback _clickedMusicListItemCllback;
	
	public MusicListFragment(){
		
	}
	
	public void setClickedMusicListItemCllback(EventCallback clickedMusicListItemCllback){
		_clickedMusicListItemCllback = clickedMusicListItemCllback;
	}
	
	public void destroy(){
		_clickedMusicListItemCllback = null;
	}
	
	@Override
	public void onListItemClick(ListView l, View v, int position, long id){
		
    	if(_clickedMusicListItemCllback != null){
    		_clickedMusicListItemCllback.onClickedMusicListItem(position, id);
    	}
	}
}